/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managed;

import entity.Resource;
import java.io.Serializable;
import java.util.Collection;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.bean.RequestScoped;
import javax.inject.Named;
import session.ModifyResourceConstructSessionBeanLocal;

/**
 *
 * @author antonio
 */
@Named(value = "modifyResourceController")
@RequestScoped
public class ModifyResourceControllerBean implements Serializable {

    @EJB
    private ModifyResourceConstructSessionBeanLocal modifyResourceConstruct;
    private Collection<Resource> resources;

    public ModifyResourceControllerBean() {
    }

    public Collection<Resource> getResources() {
       
        if (resources == null) {
            resources = modifyResourceConstruct.getResources();
        }
        return resources;

    }

    public void update() {
        modifyResourceConstruct.update(resources);
    }
}
